/* ============================================
   Village Portal - Q&A Page CSS
   Complete styling for q&a.html
   ============================================ */

:root {
  --color-primary: #0052CC;
  --color-primary-dark: #003d99;
  --color-primary-light: #4F8CFF;
  --color-secondary: #22223b;
  --color-text: #22223b;
  --color-text-light: #4b5563;
  --color-placeholder: #999;
  --color-border: #ddd;
  --color-error: #d32f2f;
  --color-success: #10b981;
  --color-bg-light: #f8f8f8;
  --color-white: #ffffff;
  --color-accent: #e0e7ff;
  --font-main: Arial, 'Helvetica Neue', sans-serif;
  --radius: 4px;
  --transition: 150ms ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-white);
  margin-left: 250px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   Header & Navigation
   ============================================ */

.portal-header {
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex-wrap: wrap;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-white);
  flex-shrink: 0;
  min-width: 0;
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.portal-tagline {
  font-size: 0.8rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.portal-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  padding: 2rem 0;
  z-index: 101;
  overflow-y: auto;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: all var(--transition);
  display: block;
  border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  border-left: 4px solid var(--color-white);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================
   Page Section Management
   ============================================ */

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Page Header Styles
   ============================================ */

.page-header {
  background: linear-gradient(135deg, #1a5490 0%, #0052CC 100%);
  color: var(--color-white);
  padding: 2rem 1rem;
  text-align: center;
}

.page-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Q&A Specific Styles
   ============================================ */

.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.qa-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.15s ease;
}

.qa-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #0052CC;
}

.qa-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: #22223b;
  margin-bottom: 0.8rem;
}

.qa-answer {
  color: #4b5563;
  line-height: 1.7;
}

/* ============================================
   Footer
   ============================================ */

.portal-footer {
  background: var(--color-secondary);
  color: var(--color-white);
  padding: 3rem 1rem 1rem 1rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-white);
}

.footer-title {
  font-size: 1.3rem;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--color-primary-light);
  margin: 0.3rem 0;
}

.footer-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-section p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.3rem 0;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 900px) {
  .nav-menu {
    gap: 0;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    gap: 1rem;
  }

  .logo-text h1 {
    font-size: 1.2rem;
  }

  body {
    margin-left: 200px;
  }

  .portal-nav {
    width: 200px;
  }

  .nav-link {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 600px) {
  body {
    margin-left: 0;
  }

  .portal-nav {
    display: none;
  }

  .page-header {
    padding: 1.5rem 1rem;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .content-section {
    padding: 1rem;
  }

  .logo-img {
    width: 40px;
    height: 40px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 400px) {
  .header-logo {
    gap: 0.5rem;
  }

  .logo-text h1 {
    font-size: 1rem;
  }

  .portal-tagline {
    font-size: 0.7rem;
  }

  .page-title {
    font-size: 1.1rem;
  }
}

/* ============================================
   Simple Q&A Styles - Clean Design
   ============================================ */

/* Search Box */
.search-container {
  margin-bottom: 2rem;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

.search-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(0, 82, 204, 0.1);
}

.search-input::placeholder {
  color: #9ca3af;
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  background: #fafbfc;
  transition: background 0.2s;
}

.faq-question:hover {
  background: #f3f4f6;
}

.question-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.5;
  flex: 1;
  padding-right: 16px;
}

.expand-icon {
  color: var(--color-primary);
  font-size: 0.8rem;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.open .expand-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer p {
  padding: 20px;
  margin: 0;
  background: #fff;
  color: var(--color-text-light);
  line-height: 1.8;
  border-top: 1px solid #e5e7eb;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 48px 24px;
  background: #f9fafb;
  border-radius: 12px;
  color: var(--color-text-light);
}

.no-results p {
  font-size: 1.1rem;
}

/* Quick Help */
.quick-help {
  margin-top: 2.5rem;
  padding: 24px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 100%);
  border-radius: 16px;
  border: 1px solid #d1e5f4;
}

.quick-help h4 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--color-text);
}

.help-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1;
  min-width: 180px;
}

.help-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.help-icon {
  font-size: 1.5rem;
}

.help-link span:last-child {
  font-weight: 500;
  color: var(--color-text);
}

/* Mobile Menu */
.portal-nav.mobile-open {
  display: block;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .search-input {
    padding: 14px 14px 14px 44px;
  }

  .faq-question {
    padding: 16px;
  }

  .question-text {
    font-size: 0.95rem;
  }

  .faq-answer p {
    padding: 16px;
  }

  .help-links {
    flex-direction: column;
  }

  .help-link {
    min-width: auto;
  }
}